<template>
  <div class="Chief-Two" chief-style-set>
    <Title title="日报数据" more :MoreUrl='MoreJump(this, "OperatingCondition", 2)'></Title>
    <div class="content-h-auto Two-box" chief-style-set>
      <div class="Two-item" v-for="(item,index) in showItem" :key="index + 'showItem'">
        <div class="item-num">{{item.value || ''}}</div>
        <div class="item-font">{{item.name || ''}}</div>
      </div>
    </div>
  </div>
</template>

<script>
import Title from "@/components/baseTitle";
import { rptVisPrjManageDaily } from "@/api/portalChief";
import { MoreJump } from "@/util/util";
export default {
  name: "Chief-Two",
  components: {
    Title
  },
  data () {
    return {
      showItem: [],
      MoreJump
    };
  },
  created () {
    this.showItem = [];
    rptVisPrjManageDaily(this.$store.state.user.project.projectNo).then(res => {
      this.disposeData(res);
    });
  },
  methods: {
    disposeData (res) {
      if (res.status === 200) {
        Object.keys(res.data.data).forEach(item => {
          this.showItem.push({
            name: item,
            value: res.data.data[item]
          });
        });
      }
    },

    // 更多点击
    handleMoreClick () {
      // MoreJump(this, "OperatingCondition", 2);
      // console.log(this.$route);
      // console.log(this.$router);
    }
  }
};
</script>

<style lang='less'>
.Chief-Two{
  background-color: #fff;

  .Two-box{
    display: flex;
    justify-content: space-around;
    align-items: center;

    .Two-item{
      flex: 1;
    }

    .item-num{
      color: #ED7D33;
      font-size: 2.5vw;
      padding: 1.5vh 0;
      font-weight: bold;
      text-align: center;
    }
    .item-font{
      text-align: center;
    }
  }
}
</style>